//
//  SoccerAppDelegate.m
//  Soccer
//
//  Created by Hyun-Woong Kim on 09. 04. 22.
//  Copyright __MyCompanyName__ 2009. All rights reserved.
//

#import "SoccerAppDelegate.h"
#import "PASoundMgr.h"

@implementation SoccerAppDelegate

- (void)applicationDidFinishLaunching:(UIApplication *)application
{

	/* 임시로 주석처리
	bgTrack = [[PASoundMgr sharedSoundManager] addSound:@"trance-loop" withExtension:@"ogg" position:CGPointZero looped:YES];
	[bgTrack setGain:0.3f];
	[bgTrack playAtListenerPosition];
	 */

	application.statusBarOrientation = UIInterfaceOrientationLandscapeRight; // alert창 가로로 전환
	
	window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
	[window setUserInteractionEnabled:YES];
	[window setMultipleTouchEnabled:YES];
	
	// landscape mode에 문제가 있음. UIViewController를 이용해서 해결
	mainViewController = [[MainViewController alloc] init];
	[window addSubview: mainViewController.view];
	[[Director sharedDirector] attachInView:mainViewController.view withFrame:CGRectMake(0, 0, 480, 320)];
	[Director sharedDirector].displayFPS = NO;
	
	[window makeKeyAndVisible];

	MenuScene *ms = [MenuScene node];
	[[Director sharedDirector] runWithScene:ms];
}

- (void)applicationWillTerminate:(UIApplication *)application
{
}

- (void)dealloc {
	[bgTrack stop];
	[bgTrack release];
	[window release];
	[mainViewController release];
	[super dealloc];
}

@end
